package com.xyy.saas.payment.cores.enums;

import lombok.Getter;

/**
 * @author liujf
 */
@Getter
public enum XydNotifyTypeEnum {
    REFUND(1, "退货"),
    REPAY(0, "还款"),
    ;
    private Integer code;

    private String name;

    XydNotifyTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static XydNotifyTypeEnum fromCode(Integer code) {
        if (REFUND.code.equals(code)) {
            return REFUND;
        } else if (REPAY.code.equals(code)) {
            return REPAY;
        } else {
            return null;
        }
    }
    public static String getNameByCode(Integer code) {
        if (REFUND.code.equals(code)) {
            return REFUND.name;
        } else if (REPAY.code.equals(code)) {
            return REPAY.name;
        } else {
            return null;
        }
    }

}
